﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;


namespace FinalTestMachine.View.Dispenser
{
    /// <summary>
    /// Unit_WeightViewModel.xaml 的交互逻辑
    /// </summary>
    public partial class Unit_WeightViewModel : UserControl
    {
        public Unit_WeightViewModel()
        {
            InitializeComponent();
        }

        bool IsCanShow = false;
        public void ShowUI()
        {
            if (!IsCanShow) return;

            //tb_ActualValue.Text = MeasureWeightHelper.Cur.ActualWeight.ToString("F5");
            //tb_MeasureValue.Text = (MeasureWeightHelper.Cur.weightData.MeasureWeightNow).ToString("F1");
            //tb_D_Value.Text = (MeasureWeightHelper.Cur.weightData.D_WeightValue).ToString("F1");


        }
        private void Btn_ZeroWeight_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //MeasureWeightHelper.Cur.Zero();

            }
            catch (Exception ex)
            {

                MessageBox.Show(ex.Message);
            }
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            IsCanShow = true;
        }

        private void UserControl_Unloaded(object sender, RoutedEventArgs e)
        {
            IsCanShow = false;
        }
    }
}
